<?php

class ReqaController extends Zend_Controller_Action
{
    protected $_id;
    
    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
    }

    public function addAction()
    {
        $step = $this->_getParam('step');
        if(!$step)
        {
            $this->_redirect('reqa/add/step/1');
        } else if ($step == 1){
            $form = new Application_Form_RequisitionSummary();
            
            $value = array("reqnum" => ' ', "deptcode" => ' ', "month" => date('m'), "year" => date('y'));
                
            $form->getElement('no_request')->setValue($value);
            $form->getElement('no_request')->setAttrib("disabled", true);
            
            if($this->_request->isPost())
            {
                if($form->isValid($this->_request->getPost()))
                {
                    $this->_redirect('reqa/add/step/2');
                }
            }
            
            $this->view->reqSummary = $form;
            
        } else if ($step == 2){
            if($this->_id) {
                $reqA = new Application_Form_RequisitionA();
                $this->view->reqA = $reqA;
            } else {
                $this->_redirect('reqa/add/step/1');
            }
        } else {
            $this->_redirect('reqa/add/step/1');
        }
        
    }

    public function editAction()
    {
        // action body
    }

    public function deleteAction()
    {
        // action body
    }

    public function viewAction()
    {
        // action body
    }


}









